<?php
/**
 * Interface for base repository class that all our repositories will inherit from.
 *
 * @package Custom_Model
 * @version $Id$
 */
interface Custom_Model_RepositoryInterface
{
    /**
     * Class contructor
     *
     * @param Zend_Config|array|null $option
     * @return App_Model_Abstract
     */
    public function __construct($option = null);

    /**
     * Construtor extensions
     */
    public function init();


    /**
     * Retreive a validation object such as Zend_Form
     *
     * Implement a service container pattern to receive a real object
     *
     * @param string $name Name of validation
     * @return Zend_Validate_Interface
     */
    public function getValidate($name);

    /**
     * Retreive a resource object such as Zend_Db_Table
     *
     * Implement a service container pattern to receive a real object
     *
     * @param string $name Name of entity resource
     * @return Custom_Model_EntityInterface
     */
    public function getResource($name);
    
    /**
     * Retreive error messages if any
     * 
     * @return array
     */
    public function getMessages();
    
    /**
     * Set error messages if any
     * 
     * @param array $messages
     * @return void
     */
    public function setMessages($messages = null);

}